Skip to content

docs: salvage x402 payment skill update - #1767

Merged
affaan-m merged 1 commit into
mainfrom
codex/stale-pr-salvage-x402
May 12, 2026
Merged

affaan-m merged 1 commit into
mainfrom
codex/stale-pr-salvage-x402

Conversation

@affaan-m

@affaan-m affaan-m commented May 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Salvages the useful part of closed community PR #1346 into the existing agent-payment-x402 skill.

This does not apply #1346 verbatim. The stale PR pointed agents at okx-x402-payment, but the current okx/onchainos-skills surface marks that as a deprecated compatibility alias and routes new work through okx-agent-payments-protocol.

What changed

  • Add a decision tree for buyer vs seller x402 payment flows.
  • Preserve the existing agentwallet-sdk MCP path for Base / multi-chain agent payments.
  • Add OKX Payments / X Layer guidance for x402, MPP, charge, session, and A2A charge flows.
  • Link current OKX seller docs for TypeScript, Go, Rust, and Java.
  • Tighten payment safety wording so payment execution remains inside orchestrator policy and explicit confirmation boundaries.

Source / verification

Test plan

  • node scripts/ci/validate-skills.js skills/agent-payment-x402/SKILL.md
  • node scripts/ci/validate-no-personal-paths.js
  • git diff --check
  • npm test (2285 passed, 0 failed)

Summary by cubic

Updates the agent-payment-x402 skill docs with a buyer/seller decision tree, current X Layer guidance via okx-agent-payments-protocol, and clearer safety boundaries, while keeping the agentwallet-sdk path for Base/multi‑chain.

  • New Features
    • Added decision tree and network guidance: use agentwallet-sdk for Base/multi-chain and okx-agent-payments-protocol for X Layer; okx-x402-payment is noted as deprecated.
    • Documented X Layer flows (x402, MPP, session, charge, A2A charge) and linked seller guides for TypeScript, Go, Rust, and Java.
    • Tightened safety language: orchestrator-owned spending policy and explicit user confirmation for wallet/payment actions.

Written for commit 29f06c7. Summary will update on new commits.

Summary by CodeRabbit

  • Documentation
    • Expanded payment execution documentation with clearer guidance on integration options for Base and X Layer networks.
    • Improved x402 protocol explanations covering negotiation, budget checks, and transaction signing.
    • Added decision tree and reference resources for implementation guidance.

Review Change Stack

@greptile-apps

greptile-apps Bot commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR extends the agent-payment-x402 skill with an OKX/X Layer integration path, salvaging the useful parts of community PR #1346 while correcting the deprecated okx-x402-payment alias to point at okx-agent-payments-protocol.

  • Adds a buyer/seller decision table routing agents to either agentwallet-sdk (Base / multi-chain) or the OKX Agent Payments Protocol (X Layer), with explicit deprecation warning for the old alias.
  • Adds a seller-guide URL table directing agents to fetch current language-specific docs (TypeScript, Go, Rust, Java) from raw GitHub before generating code; Go and Rust paths include an extra /x402/ subdirectory not present in the TypeScript and Java entries — these should be verified before merge.
  • Tightens payment safety wording so execution stays inside orchestrator policy boundaries and requires explicit confirmation, and adds three new Production Reference links for OKX resources.

Confidence Score: 3/5

Safe to merge after the seller-guide URLs are manually verified against the okx/payments repository structure.

The skill instructs agents to fetch docs from four specific raw GitHub paths at runtime. Two of those paths (Go, Rust) include a /x402/ subdirectory that the other two (TypeScript, Java) do not. If any path resolves to a 404, an agent following the skill will silently fall back to stale training-data examples — the exact failure the skill is trying to prevent. The rest of the changes (decision tree, deprecation notice, safety wording, references) are well-reasoned and tighten the existing content.

The seller-guide URL table in skills/agent-payment-x402/SKILL.md (lines 93-97) needs manual path verification before this is safe to ship.

Important Files Changed

Filename Overview
skills/agent-payment-x402/SKILL.md Documentation skill updated with OKX/X Layer decision tree and seller-guide URLs; raw GitHub URL paths for Go and Rust include an extra /x402/ subdirectory not present in the TypeScript and Java entries — if any path is wrong, agents will silently receive 404s and fall back to stale examples.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Agent needs payment] --> B{Buyer or Seller?}
    B -->|Buyer| C{Which chain?}
    B -->|Seller| D{Language?}

    C -->|Base / multi-chain| E[Option A: agentwallet-sdk MCP\nBase Sepolia → Base mainnet]
    C -->|X Layer| F[Option B: okx-agent-payments-protocol\nfrom okx/onchainos-skills]

    F --> G[Flows: x402 · MPP · session\ncharge · A2A charge]
    F --> H[⚠️ okx-x402-payment = deprecated alias]

    D -->|TypeScript| I[Fetch: okx/payments/main/typescript/SELLER.md]
    D -->|Go| J[Fetch: okx/payments/main/go/x402/SELLER.md]
    D -->|Rust| K[Fetch: okx/payments/main/rust/x402/SELLER.md]
    D -->|Java| L[Fetch: okx/payments/main/java/SELLER.md]
    D -->|Python| M[⚠️ Guide may not exist — check repo first]

    E --> N[Set SpendingPolicy via orchestrator\nbefore delegating to agent]
    F --> N
Loading

Comments Outside Diff (1)

  1. skills/agent-payment-x402/SKILL.md, line 210-215 (link)

    P2 Best Practices omits X Layer development path

    Now that the skill covers both Base and X Layer, the Best Practices section still only names Base Sepolia as the development default and Base mainnet as the production target, with no guidance on the equivalent X Layer testnet (if one exists). A developer implementing Option B with no prior OKX experience has no safe sandbox path from the skill alone, and may deploy directly to eip155:196 mainnet.

Reviews (1): Last reviewed commit: "docs: salvage x402 payment skill update" | Re-trigger Greptile

Comment on lines +93 to +97
|---------|---------------|
| TypeScript | `https://raw.githubusercontent.com/okx/payments/main/typescript/SELLER.md` |
| Go | `https://raw.githubusercontent.com/okx/payments/main/go/x402/SELLER.md` |
| Rust | `https://raw.githubusercontent.com/okx/payments/main/rust/x402/SELLER.md` |
| Java | `https://raw.githubusercontent.com/okx/payments/main/java/SELLER.md` |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Asymmetric raw-URL paths for seller guides

The Go and Rust entries include an /x402/ subdirectory (e.g. main/go/x402/SELLER.md) while TypeScript and Java do not (e.g. main/typescript/SELLER.md). If any of these paths are wrong, an agent following the skill will silently fetch a 404 and fall back to stale training-data examples — the exact failure mode the skill is trying to prevent. Please double-check that all four paths exist verbatim in the okx/payments repository before merging.

@coderabbitai

coderabbitai Bot commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 33135046-10c2-454c-b32e-0657b00cdbac

📥 Commits

Reviewing files that changed from the base of the PR and between 9428f28 and 29f06c7.

📒 Files selected for processing (1)
  • skills/agent-payment-x402/SKILL.md

📝 Walkthrough

Walkthrough

Documentation for the x402 payment execution skill has been expanded with updated metadata, rewritten guidance emphasizing policy-gated payments, new decision and network guidance sections, clarified protocol explanation, dual integration paths (agentwallet-sdk and OKX Agent Payments Protocol), and production references.

Changes

x402 Payment Skill Documentation

Layer / File(s) Summary
Metadata and Frontmatter
skills/agent-payment-x402/SKILL.md
Skill description updated to emphasize x402 payment execution with per-task budgets, spending controls, non-custodial wallets, Base support via agentwallet-sdk, and X Layer support via OKX Payments.
Introductory Guidance and Context
skills/agent-payment-x402/SKILL.md
Opening guidance rewritten to position payments as policy-gated via x402 + MCP tools with built-in spending controls; "When to Use" section strengthened.
Decision Tree and Network Support
skills/agent-payment-x402/SKILL.md
Decision Tree table added mapping agent payment needs to integration paths; Supported Networks section clarifies agentwallet-sdk coverage and guidance for fetching current OKX/X Layer seller documentation.
x402 Protocol Explanation
skills/agent-payment-x402/SKILL.md
x402 Protocol section clarified to specify orchestrator-scoped retry boundaries, budget checks, negotiation/signing steps, and confirmation scope triggered on HTTP 402.
Integration Path Options A and B
skills/agent-payment-x402/SKILL.md
Option A heading added for agentwallet-sdk (Base/multi-chain); Option B section added for OKX Agent Payments Protocol (X Layer) with buyer-side setup, deprecation guidance, explicit confirmation requirements, and language-specific seller guide links.
Production References
skills/agent-payment-x402/SKILL.md
Production reference links appended for OKX Payments SDKs, OKX Agent Payments Protocol skill, and OKX Payments overview.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 Hops through docs with markdown cheer,
Two payment paths now crystal clear—
Base and X Layer, side by side,
With budgets set and flows applied,
The x402 skill takes its stride! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'docs: salvage x402 payment skill update' clearly describes the main change — salvaging and updating x402 payment documentation. It is specific and directly related to the changeset, which focuses on expanding and improving the SKILL.md file for x402 payment execution.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/stale-pr-salvage-x402

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@affaan-m
affaan-m merged commit e5229ce into main May 12, 2026
39 checks passed
@affaan-m
affaan-m deleted the codex/stale-pr-salvage-x402 branch May 12, 2026 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant